<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style>
    body {
      width: 1200px;
      height: 60000px;
      background-color: red;
      /* 父级没写position就是所谓的父级没定位 */
      /* position: relative; */
    }
    .content {
      width: 600px;
      height: 30000px;
      background-color: yellowgreen;
    }
    .search {
      width: 400px;
      height: 200px;
      background-color: pink;
      position: absolute;

      top: 100px;
      /* 祖先未定位，则相对“浏览器可视区”改变位置。但效果有点不好理解，且不是fixed的效果 */
      left: 50%;
      /* transform: translateX(-50%); */
    }
    </style>
  </head>
  <body>
  <div class="search"></div>
  <div class="content">文字内容</div>
  </body>
</html>
